/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: mirac
 * Date: 2025-11-18
 * Time: 18:22
 */
public class Solution1 {
    public int multiply(int A, int B) {
        int count = Math.min(A,B);
        int sum = Math.max(A, B);
        for (int i = 1; i < count; i++) {
            sum += Math.max(A, B);
        }
        return sum;
    }
}
